package com.design03_behavioral.pattern17_state.example01;

/**
 * @ClassName Client
 * @Description TODO
 * @Author zhangjunhao
 * @DATE 2023/9/9 2:41
 */
public class Client {

    public static void main(String[] args) {

        Context context = new Context();
        State state1 = new ConcreteStateA();
        state1.handle(context);
        System.out.println(context.getCurrentState().toString());
        System.out.println("========================");
        State state2 = new ConcreteStateB();
        state2.handle(context);
        System.out.println(context.getCurrentState().toString());
        //进入状态模式A......
        //当前状态: ConcreteStateA
        //========================
        //进入状态模式B......
        //当前状态: ConcreteStateB

    }

}
